package com.zhuss.controller.product;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.zhuss.bean.bo.product.product.DetailProductBo;
import com.zhuss.bean.bo.product.product.SearchProductBo;
import com.zhuss.common.BaseController;
import com.zhuss.common.ReadService;
import com.zhuss.product.product.ProductReadServiceExt;
import com.zhuss.exception.OceanException;


/**
 * @description: 商品查询Controller
 * @author: zhushanshuo
 * @create: Wed Mar 24 22:26:45 CST 2021
 **/
@RestController
@RequestMapping("/product")
public class ProductReadController extends BaseController {
	
	@Autowired
	@Qualifier("productReadService")
	private ReadService<Object, Object> productReadService;
	
	@Autowired
	@Qualifier("productReadServiceExt")
	private ProductReadServiceExt productReadServiceExt;
	
	/**
	 * 详情
	 * @param bo
	 * @return
	 * @throws OceanException
	 */
	@ResponseBody
	@RequestMapping("/detail")
    public Object detail(@RequestBody DetailProductBo bo) throws OceanException {
		
		Object result = productReadService.detail(bo);
		return result;
    }
	
	/**
	 * 列表
	 * @param bo
	 * @return
	 * @throws OceanException
	 */
	@ResponseBody
    @RequestMapping("/list")
    public Object list(@RequestBody SearchProductBo bo) throws OceanException {
		
		Object result = productReadService.list(bo);
		return result;
    }
	
}
